﻿module Sustainalytics.GovernanceReports.Admin {

    import Common = Sustainalytics.Common;
    import CommonAdmin = Sustainalytics.Common.Admin;

    // Portfolio List controller
    export class DeleteCheckController {

        public resultCheck: boolean;

        // Ctor.
        constructor(
            private $rootScope: ng.IScope,
            private $scope: ng.IScope,
            private $q: ng.IQService,
            private $location: ng.ILocationService,
            private $modal: IModal,
            private $modalInstance: IModalInstance) {

            var ctx = this;
            $scope['deleteCheck'] = ctx;
        }

        public closeDialog = function () {
            var ctx = this;
            ctx.resultCheck = false;
            ctx.$modalInstance.close({ deleteCheck: ctx.resultCheck });
        };

        public deleteProfileInsight() {
            var ctx = this;
            var def = this.$q.defer();
            ctx.resultCheck = true;
            this.$modalInstance.close({ deleteCheck: ctx.resultCheck });
        }
    }


    // register controller with GovernanceReports Angular module
    var mod = angular.module(governanceAdminReportsModuleName);
    
    mod.controller('DeleteCheckController',
        ['$rootScope', '$scope', '$q', '$location', '$modal', '$modalInstance', DeleteCheckController]);
} 
  